import 'package:device_info_plus/device_info_plus.dart';
import 'package:event_bus/event_bus.dart';
import 'package:flutter/material.dart';
import 'dart:ui';
import 'Color.dart';
import 'Images.dart';
import 'package:package_info/package_info.dart';
import 'dart:io';


class Config{

  ///获取状态栏高度
  static double top = MediaQueryData.fromWindow(window).padding.top;

  ///app上下文
  static late BuildContext context;

  ///是否进入过app
  static bool isOpened = false;

  ///App的名字
  static String appName = 'thinking';

  ///保存app信息
  static late PackageInfo packageInfo;

  ///是否为android
  static bool isAndroid = Platform.isAndroid;

  ///保存安卓设备信息
  static AndroidDeviceInfo? androidDeviceInfo;

  /// 是否为 ios
  static bool isIos = Platform.isIOS;

  /// 保存 ios 设备信息
  static late IosDeviceInfo iosDeviceInfo;

  ///app的上下文
  static late BuildContext appContext;

  ///事件控制中心
  static late EventBus eventBus;

  ///权限请求结果
  static bool isPermission = false;



  ///接口地址
  static final Map<String,dynamic> apiUrl = {
    'BasePhotoUrl':'http://192.168.43.64:4001/img/',
    'BaseUrl':'http://192.168.43.64:4001/think/api/v1/',
    'ApiList':{
      'login':'user/userLogin',
      'getUserData':'user/getUserData',
      'getUserDynamic':'user/getUserDynamic',
      'getClass':'classData/getClassData',
      'getHomeData':'home/getHomeData',
      'isLikeThink':'home/isLikeThink',
      'getSearchRecommend':'search/getSearchRecommend',
      'getHistorySplashData':'history/getHistorySplashData',
      'getDynamicData':'dynamic/getDynamicData',
      'changeDynamicLike':'dynamic/changeDynamicLike',
      'searchTag':'dynamic/searchTag',
      'dynamicNew':'dynamic/dynamicNew',
      'getAllCountry':'country/getAllCountry',
      'getAllTime':'country/getAllTime',
      'getAllThink':'country/getAllThink',
      'getHistoryThink':'history/getHistoryThink',
      'getClassScreen':'class/getClassScreen',
      'getClassListValue':'class/getClassListValue',
      'upLoadFile':'public/upLoadFile',
      'getSearchThinkData':'search/getSearchThinkData',
      'getSearchDynamicData':'search/getSearchDynamicData',
      'getSearchUserData':'search/getSearchUserData',
      'getSearchTopicData':'search/getSearchTopicData',
      'changeUserFollow':'user/changeUserFollow',
      'getRecentVisitUserData':'dynamic/getRecentVisitUserData',
      'topicContent':'topic/topicContent',
      'changeSubTopic':'topic/changeSubTopic',
      'getAllTagClass':'topic/getAllTagClass',
      'getIndexAllTopic':'topic/getIndexAllTopic',
      'getUserFollowOrFans':'user/getUserFollowOrFans',
      'getLikeDynamicList':'user/getLikeDynamicList',
      'getLikeThinkList':'user/getLikeThinkList',
      'getPersonalDynamicList':'user/getPersonalDynamicList',
      'getPersonalThinkList':'user/getPersonalThinkList',
      'updateApp':'public/updateApp',
      'updateUserData':'user/updateUserData',
      'getThinkInfo':'home/getThinkInfo',
      'isCollectionThink':'home/isCollectionThink',
      'dynamicInfo':'dynamic/dynamicInfo',
      'changeDynamicCollection':'dynamic/changeDynamicCollection',
      'setRecentVisit':'home/setRecentVisit'
    }

  };

  ///welcome页的轮播配置
  static List<Map<String,dynamic>>  welComeConfig = [
    {
      'topTitle':'海量争议事件',
      'topCenter':'颠覆想象， 放飞三观旅行',
      'imageUrl':Images.libStaticImgWelcome1
    },
    {
      'topTitle':'热门动态呈现',
      'topCenter':'思想碰撞，人文交流',
      'imageUrl':Images.libStaticImgWelcome2
    },
    {
      'topTitle':'个性化空间',
      'topCenter':'展现最好的你',
      'imageUrl':Images.libStaticImgWelcome3
    }

  ];

  ///话题热词配置
  static List<Map<String,dynamic>> hotText =[
    {
      'val':'荐',
      'color':Colors.blue
    },
    {
      'val':'新',
      'color':Colors.orangeAccent
    },
    {
      'val':'热',
      'color':Colors.deepOrange
    },
    {
      'val':'爆',
      'color':ColorConfig.ThemeColor
    }
  ];



  ///分页筛选数据处理
  static List<Map<String,dynamic>> classListScreen = [
    {
      "name":'分画作',
      "classList":[
        {
          "id":0,
          "name":'风格流派',
          "entityName":'PaintStyleEntity'
        },
        {
          "id":1,
          "name":'题材',
          "entityName":'PaintThemeEntity'
        },
        {
          "id":2,
          "name":'材质',
          "entityName":'PaintRawEntity'
        },
      ]
    },
    {
      "name":'分古籍',
      "classList":[
        {
          "id":0,
          "name":'派别',
          "entityName":'AncientPositionEntity'
        },
        {
          "id":1,
          'name':'类型',
          "entityName":'AncientTypeEntity'
        },
      ]

    }
  ];

  ///复制的筛选处理
  static List<Map<String,dynamic>> classListScreenCopy = [
    {
      "name":'分画作',
      "classList":[
        {
          "id":0,
          "name":'风格流派',
          "entityName":'PaintStyleEntity'
        },
        {
          "id":1,
          "name":'题材',
          "entityName":'PaintThemeEntity'
        },
        {
          "id":2,
          "name":'材质',
          "entityName":'PaintRawEntity'
        },
      ]
    },
    {
      "name":'分古籍',
      "classList":[
        {
          "id":0,
          "name":'派别',
          "entityName":'AncientPositionEntity'
        },
        {
          "id":1,
          'name':'类型',
          "entityName":'AncientTypeEntity'
        },
      ]

    }
  ];

}

